﻿#ifndef USERRELATIONNETWORKACCESSMANAGER_H
#define USERRELATIONNETWORKACCESSMANAGER_H

#include "basenetworkaccessmanager.h"
#include "userrelation.h"

class UserRelationNetworkAccessManager : public BaseNetworkAccessManager
{
    Q_OBJECT
public:
    explicit UserRelationNetworkAccessManager(QObject *parent = nullptr);

    void queryPlatformUser(QString username, QString companyId);

    void addPlatformUser(QString sourceUsername, QString targetUsername, UserRelation::RelationType type);

    void getUserRelations(QString username, UserRelation::RelationType type);

    void addNonPlatformUser(
            QString username,
            UserRelation::RelationType type,
            QString nickName,
            QString contact,
            QString tel,
            QString remark,
            QString primaryDirectory,
            QString secondaryDirectory);

    void queryUserRelationDetail(QString username, QString companyId);

    void buildSubAccount(QString sourceUsername, QString targetUsername, UserRelation::RelationType type);

    void changeUserRelation(QString sourceUsername, QString targetUsername, UserRelation::RelationType type);

    void updateUserRelation(
            QString sourceUsername,
            QString targetUsername,
            UserRelation::RelationType type,
            QString urClientName,
            QString urContact,
            QString urTel,
            QString urRemark,
            QString urCredit,
            QString urPrimaryDirectory,
            QString urSecondaryDirectory,
            QString userNickName,
            QString userPosition,
            QString userTel,
            QString userMobile,
            QString userQQ,
            QString userWechat,
            QString companyCompanyName,
            QString companyContact,
            QString companyTel,
            QString companyFax,
            QString companyWebsite,
            QString companyEmail,
            QString companyProvince,
            QString companyCity,
            QString companyDistrict,
            QString companyAddress,
            QString companyAccount,
            QString companyIntroduction,
            QString companyTicketCompanyName,
            QString companyTaxNum,
            QString companyBank,
            QString companyTicketAccount,
            QString companyTicketTel,
            QString companyTicketAddress);

    void uploadUserRelation(QString username, UserRelation::RelationType type, QList<UserRelation*> relations);

    void adjustUserRelationFinance(
            QString sourceUsername,
            QString targetUsername,
            QString relatedMessageId,
            int relationType,
            double oldTicketIn,
            double oldTicketOut,
            double oldMoneyIn,
            double oldMoneyOut,
            double ticketIn,
            double ticketOut,
            double moneyIn,
            double moneyOut);

    void deleteUserRelation(
            QString sourceUsername,
            QString targetUsername,
            int relationType);
signals:

public slots:
};

#endif // USERRELATIONNETWORKACCESSMANAGER_H
